package abs.dao;

import abs.domain.GrupoClientes;

import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import org.skyway.spring.util.dao.AbstractJpaDao;

import org.springframework.dao.DataAccessException;

import org.springframework.stereotype.Repository;

import org.springframework.transaction.annotation.Transactional;

/**
 * DAO to manage GrupoClientes entities.
 * 
 */
@Repository("GrupoClientesDAO")
@Transactional
public class GrupoClientesDAOImpl extends AbstractJpaDao<GrupoClientes>
		implements GrupoClientesDAO {

	/**
	 * Set of entity classes managed by this DAO.  Typically a DAO manages a single entity.
	 *
	 */
	private final static Set<Class<?>> dataTypes = new HashSet<Class<?>>(Arrays.asList(new Class<?>[] { GrupoClientes.class }));

	/**
	 * EntityManager injected by Spring for persistence unit absV2
	 *
	 */
	@PersistenceContext(unitName = "absV2")
	private EntityManager entityManager;

	/**
	 * Instantiates a new GrupoClientesDAOImpl
	 *
	 */
	public GrupoClientesDAOImpl() {
		super();
	}

	/**
	 * Get the entity manager that manages persistence unit 
	 *
	 */
	@Override
	public EntityManager getEntityManager() {
		return entityManager;
	}

	/**
	 * Returns the set of entity classes managed by this DAO.
	 *
	 */
	@Override
	public Set<Class<?>> getTypes() {
		return dataTypes;
	}

	/**
	 * JPQL Query - findGrupoClientesByPrimaryKey
	 *
	 */
	@Override
	@Transactional
	public GrupoClientes findGrupoClientesByPrimaryKey(String grpcl100nocia, String grpcl100cdgo) throws DataAccessException {

		return findGrupoClientesByPrimaryKey(grpcl100nocia, grpcl100cdgo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByPrimaryKey
	 *
	 */

	@Override
	@Transactional
	public GrupoClientes findGrupoClientesByPrimaryKey(String grpcl100nocia, String grpcl100cdgo, int startResult, int maxRows) throws DataAccessException {
		try {
			Query query = createNamedQuery("findGrupoClientesByPrimaryKey", startResult, maxRows, grpcl100nocia, grpcl100cdgo);
			return (abs.domain.GrupoClientes) query.getSingleResult();
		} catch (NoResultException nre) {
			return null;
		}
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100nociaContaining
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100nociaContaining(String grpcl100nocia) throws DataAccessException {

		return findGrupoClientesByGrpcl100nociaContaining(grpcl100nocia, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100nociaContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100nociaContaining(String grpcl100nocia, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100nociaContaining", startResult, maxRows, grpcl100nocia);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100cdgo
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100cdgo(String grpcl100cdgo) throws DataAccessException {

		return findGrupoClientesByGrpcl100cdgo(grpcl100cdgo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100cdgo
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100cdgo(String grpcl100cdgo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100cdgo", startResult, maxRows, grpcl100cdgo);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100nameContaining
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100nameContaining(String grpcl100name) throws DataAccessException {

		return findGrupoClientesByGrpcl100nameContaining(grpcl100name, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100nameContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100nameContaining(String grpcl100name, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100nameContaining", startResult, maxRows, grpcl100name);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100load
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100load(String grpcl100load) throws DataAccessException {

		return findGrupoClientesByGrpcl100load(grpcl100load, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100load
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100load(String grpcl100load, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100load", startResult, maxRows, grpcl100load);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100name
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100name(String grpcl100name) throws DataAccessException {

		return findGrupoClientesByGrpcl100name(grpcl100name, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100name
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100name(String grpcl100name, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100name", startResult, maxRows, grpcl100name);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100nocia
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100nocia(String grpcl100nocia) throws DataAccessException {

		return findGrupoClientesByGrpcl100nocia(grpcl100nocia, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100nocia
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100nocia(String grpcl100nocia, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100nocia", startResult, maxRows, grpcl100nocia);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100loadContaining
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100loadContaining(String grpcl100load) throws DataAccessException {

		return findGrupoClientesByGrpcl100loadContaining(grpcl100load, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100loadContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100loadContaining(String grpcl100load, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100loadContaining", startResult, maxRows, grpcl100load);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100femo
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100femo(java.util.Calendar grpcl100femo) throws DataAccessException {

		return findGrupoClientesByGrpcl100femo(grpcl100femo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100femo
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100femo(java.util.Calendar grpcl100femo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100femo", startResult, maxRows, grpcl100femo);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100feadAfter
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100feadAfter(java.util.Calendar grpcl100fead) throws DataAccessException {

		return findGrupoClientesByGrpcl100feadAfter(grpcl100fead, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100feadAfter
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100feadAfter(java.util.Calendar grpcl100fead, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100feadAfter", startResult, maxRows, grpcl100fead);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100clasContaining
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100clasContaining(String grpcl100clas) throws DataAccessException {

		return findGrupoClientesByGrpcl100clasContaining(grpcl100clas, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100clasContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100clasContaining(String grpcl100clas, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100clasContaining", startResult, maxRows, grpcl100clas);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findAllGrupoClientess
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findAllGrupoClientess() throws DataAccessException {

		return findAllGrupoClientess(-1, -1);
	}

	/**
	 * JPQL Query - findAllGrupoClientess
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findAllGrupoClientess(int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findAllGrupoClientess", startResult, maxRows);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByPrimaryKey
	 *
	 */
	@Transactional
	public GrupoClientes findGrupoClientesByPrimaryKey(String grpcl100cdgo) throws DataAccessException {

		return findGrupoClientesByPrimaryKey(grpcl100cdgo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByPrimaryKey
	 *
	 */

	@Transactional
	public GrupoClientes findGrupoClientesByPrimaryKey(String grpcl100cdgo, int startResult, int maxRows) throws DataAccessException {
		try {
			Query query = createNamedQuery("findGrupoClientesByPrimaryKey", startResult, maxRows, grpcl100cdgo);
			return (abs.domain.GrupoClientes) query.getSingleResult();
		} catch (NoResultException nre) {
			return null;
		}
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100femoBefore
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100femoBefore(java.util.Calendar grpcl100femo) throws DataAccessException {

		return findGrupoClientesByGrpcl100femoBefore(grpcl100femo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100femoBefore
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100femoBefore(java.util.Calendar grpcl100femo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100femoBefore", startResult, maxRows, grpcl100femo);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100femoAfter
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100femoAfter(java.util.Calendar grpcl100femo) throws DataAccessException {

		return findGrupoClientesByGrpcl100femoAfter(grpcl100femo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100femoAfter
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100femoAfter(java.util.Calendar grpcl100femo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100femoAfter", startResult, maxRows, grpcl100femo);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100esta
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100esta(String grpcl100esta) throws DataAccessException {

		return findGrupoClientesByGrpcl100esta(grpcl100esta, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100esta
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100esta(String grpcl100esta, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100esta", startResult, maxRows, grpcl100esta);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100lomoContaining
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100lomoContaining(String grpcl100lomo) throws DataAccessException {

		return findGrupoClientesByGrpcl100lomoContaining(grpcl100lomo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100lomoContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100lomoContaining(String grpcl100lomo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100lomoContaining", startResult, maxRows, grpcl100lomo);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100estaContaining
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100estaContaining(String grpcl100esta) throws DataAccessException {

		return findGrupoClientesByGrpcl100estaContaining(grpcl100esta, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100estaContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100estaContaining(String grpcl100esta, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100estaContaining", startResult, maxRows, grpcl100esta);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100fead
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100fead(java.util.Calendar grpcl100fead) throws DataAccessException {

		return findGrupoClientesByGrpcl100fead(grpcl100fead, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100fead
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100fead(java.util.Calendar grpcl100fead, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100fead", startResult, maxRows, grpcl100fead);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100cdgoContaining
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100cdgoContaining(String grpcl100cdgo) throws DataAccessException {

		return findGrupoClientesByGrpcl100cdgoContaining(grpcl100cdgo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100cdgoContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100cdgoContaining(String grpcl100cdgo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100cdgoContaining", startResult, maxRows, grpcl100cdgo);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100lomo
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100lomo(String grpcl100lomo) throws DataAccessException {

		return findGrupoClientesByGrpcl100lomo(grpcl100lomo, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100lomo
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100lomo(String grpcl100lomo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100lomo", startResult, maxRows, grpcl100lomo);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100clas
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100clas(String grpcl100clas) throws DataAccessException {

		return findGrupoClientesByGrpcl100clas(grpcl100clas, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100clas
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100clas(String grpcl100clas, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100clas", startResult, maxRows, grpcl100clas);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100feadBefore
	 *
	 */
	@Override
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100feadBefore(java.util.Calendar grpcl100fead) throws DataAccessException {

		return findGrupoClientesByGrpcl100feadBefore(grpcl100fead, -1, -1);
	}

	/**
	 * JPQL Query - findGrupoClientesByGrpcl100feadBefore
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<GrupoClientes> findGrupoClientesByGrpcl100feadBefore(java.util.Calendar grpcl100fead, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findGrupoClientesByGrpcl100feadBefore", startResult, maxRows, grpcl100fead);
		return new LinkedHashSet<GrupoClientes>(query.getResultList());
	}

	/**
	 * Used to determine whether or not to merge the entity or persist the entity when calling Store
	 * @see store
	 * 
	 *
	 */
	@Override
	public boolean canBeMerged(GrupoClientes entity) {
		return true;
	}
}
